package com.fc.mall.util;

import lombok.Getter;

public class Constants {
    private Constants () {}


    public static final String SLASH = "/";

    public static final String USER_ID = "userId";

    public static final String STATUS = "status";

    public static final String STATUS_REASON = "statusReason";

    public static final String CREATED_AT = "createdAt";

    public static final String UPDATED_AT = "updatedAt";

    public static final String RVN = "rvn";

    public static final String UNDERSCORE_ID = "_id";

    public static final String ID = "id";

    public static final String NAME = "name";

    public static final String VALUE = "value";

    public static final String TRUE = "true";

    public static final String FALSE = "false";

    public static final String DEFAULT_HEADPORTAL = "https://dobuymall.oss-cn-shanghai.aliyuncs.com/wxapplet/icon/user-heard-icon.png";

    /**
     * 积分设置中开关为打开状态
     */
    public static final Integer SW_OPEN = 1;

    /**
     * 连续签到积分奖励天数
     */
    public static final Integer CONTINUE_SIGN = 7;

    /**
     * 购物100元获取积分
     */
    public static final Integer TRAND_EXCHANGE_MONEY = 100;

    /**
     * common status
     */
    public enum Status
    {
        /**
         * 1- 可用的，激活的，肯定的
         */
        Active(1),
        /**
         * 0- 不可用的，未激活的，否定的
         */
        Inactive(0);

        private int value;

        Status(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 新注册会员是否在一定时间内锁定推荐人
     */
    public enum NeedToLock
    {
        /**
         * 无需临时锁定，直接变为真正会员，即推荐人无法在后期变更
         */
        Notlock(0),
        /**
         * 需要临时锁定，等待会员购物后变为真正会员
         */
        NeedLock(1);


        private int value;

        NeedToLock(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 会员锁定推荐人状态
     */
    public enum MemberLockStatus
    {
        /**
         * 未锁定，可以更换推荐人
         */
        Unlock(0),
        /**
         * 锁定，无法更换推荐人
         */
        Lock(1),
        /**
         * 临时锁粉，暂时无法更换推荐人
         */
        TempLock(2);


        private int value;

        MemberLockStatus(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 升级操作
     */
    public enum UpgradeOperation
    {
        /**
         * 邀请新人
         */
        Invite(1),
        /**
         * 分佣
         */
        Trade(2),

        SpecialTrad(3);

        private int value;

        UpgradeOperation(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 升级条件选项方式：
     */
    public enum UpgradeCondition
    {
        /**
         * 并且
         */
        And(1),
        /**
         * 或
         */
        Or(2);

        private Integer value;

        UpgradeCondition(Integer value) {
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }
    }

    /**
     * 用户等级类型
     */
    public enum MemberLevelType
    {
        /**
         * 普通会员
         */
        Member(1),
        /**
         * 代理商
         */
        Agent(2),

        /**
         * 合伙人
         */
        Partner(3);

        private int value;

        MemberLevelType(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 会员账户类型
     */
    public enum AccountType
    {
        /**
         *  会员账号
         */
        MemberAccount(1),
        /**
         * 会员待发放金账户
         */
        WaitAccount(2);


        private int value;

        AccountType(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }
    }

    /**
     * 会员账户类型
     */
    public enum AccountChangeType
    {
        /**
         *  购物佣金
         */
        ShoppingCommission(1, "购物佣金"),
        /**
         * 提现奖励
         */
        WithdrawDepositReward(2, "提现奖励"),
        /**
         * 购物消费(购物抵扣)
         */
        ShoppingConsumption(3, "购物消费(购物抵扣)"),
        /**
         * 提现
         */
        WithdrawDeposit(4, "提现"),
        /**
         * 手动增加
         */
        ManualIncrease(5, "手动增加"),
        /**
         * 手动减少
         */
        ManualReduce(6, "手动减少");
        private int value;
        private String desc;

        AccountChangeType(int value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public int getValue() {
            return value;
        }

        public String getDesc()
        {
            return desc;
        }
    }

    /**
     * 系统配置参数名称
     */
    public enum SysPropertyConfigName
    {
        /**
         *  推荐人时是否临时锁定粉丝
         */
        LockReferer("1", "lockReferer"),
        /**
         * 拉新时临时锁定时间
         */
        LockDuration("48", "lockDuration"),
        /**
         * 推荐人/上级代理商分佣百分比
         */
        RefererRate("40", "refererRate"),
        /**
         * 上级的上级代理商分佣百分比
         */
        SuperRefererRate("30", "superRefererRate"),
        /**
         * 合伙人分佣百分比
         */
        PartnerRate("30", "partnerRate"),

        /**
         * 平台资质图片地址
         */
        PlatformAptitude("", "platformAptitude"),

        /**
         * 微信小程序App ID
         */
        APPID("", "appId"),

        /**
         * 微信秘钥
         */
        APPSECRECT("", "appSecrect"),

        /**
         * 证书
         */
        CERT("", "cert"),

        /**
         * 微信支付商家ID
          */
        MCHID("", "mchId"),

        /**
         * 微信支付回调URL
         */
        NOTIFYURL("", "notifyURL"),

        /**
         * 商家支付秘钥
         */
        PAYKEY("", "payKey"),


        /**
         *  OSS 端点
         */
        ENDPOINT("", "endpoint"),

        /**
         * OSS accesskey
         */
        ACCESSKEYID("", "accessKeyId"),

        /**
         * bucketName
         */
        BUCKETNAME("", "bucketName"),

        /**
         *
         */
        MAXSIZE("10", "maxSize"),

        /**
         *
         */
        CALLBACK("", "callback"),

        /**
         *
         */
        prefix("", "prefix"),

        /**
         *
         */
        expire("", "expire"),


        promoteShareTitle("豆拜有好货", "shopName"),

        shareImageBackground("", "promote_share_image_background"),

        BUYERSELFCOMMISSION("是否自购分佣", "buyer_self_commission"),

        PAYMENTDEBUG("支付开关", "payment_debug");
        private String value;
        private String name;

        SysPropertyConfigName(String value, String name) {
            this.value = value;
            this.name = name;
        }

        public String getValue() {
            return value;
        }
        public String getName()
        {
            return name;
        }
    }

    public enum SysPropertyConfigCategory {
        /**
         * 等级分佣设置
         */
        REFERER_RATE_SETTING(1),

        /**
         *  商家信息设置
         */
        MERCHENT_SETTING(2),
        /**
         * 微信相关设置
         */
        WECHAT_SETTING(3),
        /**
         * OSS设置
         */
        OSS_SETTING(4),
        /**
         * 提现设置
         */
        WITHDRAW_SETTING(5),

        /**
         * 推广分享
         */
        PROMOTE_SHARE(6);

        private Integer value;

        SysPropertyConfigCategory(Integer value)
        {
            this.value = value;
        }

        public Integer getValue()
        {
            return this.value;
        }

    }

    /**
     * 提现配置参数名称
     */
    @Getter
    public enum withdrawConfig {
        CLOSE("close"),
        CLOSE_TIP("close_tip"),
        FEE("fee"),
        MIN_AMOUNT("min_amount"),
        AUDIT_AMOUNT("audit_amount"),
        REMARK("remark");

        private String code;

        withdrawConfig(String code) {
            this.code = code;
        }

        public String getExternalCode() {
            return "withdraw_configs_" + this.code;
        }
    }

    /**
     * 积分变动历史中的改变类型
     */
    @Getter
    public enum ChangeTypeEnum{
        /**
         * 增加
         */
        ADD(0),

        /**
         * 减少
         */
        REDUCE(1);

        private Integer value;

        ChangeTypeEnum(Integer value){
            this.value = value;
        }
    }

    /**
     * 积分变动历史中的积分来源
     */
    @Getter
    public enum SourceTypeEnum{
        /**
         * 购物获取积分
         */
        TRADE(0, "购物"),

        /**
         * 管理员修改
         */
        ADMIN_CHANGE(1, "管理员修改"),

        /**
         * 签到获取积分
         */
        SIGN(2, "签到"),

        /**
         * 分享获取积分
         */
        SHARE(3, "分享"),

        /**
         * 邀请获取积分
         */
        INVITE(4, "邀请粉丝");

        private Integer value;

        private String description;

        SourceTypeEnum(Integer value, String description){
            this.value = value;
            this.description = description;
        }
    }

    @Getter
    public enum OrderStatus
    {
        WAITING_FOR_PAYMENT(0, "待付款"),
        WAITING_FOR_DELIVERY(1, "待发货"),
        HAS_DELIVERY(2, "已发货"),
        HAS_RECEIVE(3, "已完成"),
        HAS_CLOSED(4, "已关闭"),
        INVALID_ORDERS(5, "无效订单");

        private Integer value;
        private String desc;

        OrderStatus(Integer value, String desc)
        {
            this.value = value;
            this.desc = desc;
        }
    }
}
